import Opt from '@/components/dt/info/Opt.js'
import dt from '@dt/dt'

class RoomOpt extends Opt {

  constructor(info, type) {
    super(info)
    this.type = type
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      [{
        title: '姓名',
        key: 'userName',
        col: 8,
        text: {},
      }, {
        title: '人员工号',
        key: 'workNo',
        col: 8,
        text: { tooltip: false },
      }, {
        title: '手机号',
        key: 'phone',
        col: 8,
        text: { tooltip: false },
      }],
      [{
        title: '成员状态',
        key: 'userName',
        col: 8,
        text: {},
        data: {
          from: (info) => {
            return dt.dictInfo().__value('teamUser', info.buildingType)
          }
        }
      }, {
        title: '是否在编',
        key: 'compile',
        col: 8,
        text: {},
        data: {
          from: (info) => {
            return info.compile ? info.compile == 1 ? '是' : '否' : '否'
          }
        }
      }]
    ]
  }
}

export default RoomOpt